﻿using System.Threading;

namespace TfsWrapper
{
    internal static class ShutdownHandle
    {
        private static readonly EventWaitHandle Handle = new ManualResetEvent(false);

        public static bool HasExited()
        {
            return Handle.WaitOne(1);
        }

        public static void LetGo()
        {
            //LogManager.GetLogger(typeof(ExitEvent)).Info("Exit Command Started!");
            Handle.Set();
        }

        public static void Wait()
        {
            Handle.WaitOne();
        }
    }
}